const state = {
  num: 11// 需要管理的状态数据
}
const mutations = {
  changeCity (state, city) {
    state.city = city
    try {
      localStorage.city = city
      console.log('执行成功')
      console.log(localStorage.city)
    } catch (e) {
    }
  }
}
const actions = {
  updateCity (context, payload) {
    setTimeout(() => {
      context.commit('changeCity', payload)
      console.log(payload)
    }, 1000)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
